<?php
    /**
     * IPushMessage.php
     *
     * Created by PhpStorm.
     * author: liuml  <liumenglei0211@163.com>
     * DateTime: 2018/7/28  15:29
     */

    namespace data\api;


    interface IPushMessage
    {
        /**
         * 生成日志
         * @param $data
         * @return bool
         */
        public function addMessageLog($data);

        /**
         * 获取日志
         * @param $type
         * @return mixed
         */
        public function getMessageLog($type);

        /**
         * 发送模板消息
         * @param $openid
         * @param $templateId
         * @param $data
         * @param string $uri
         * @return mixed
         */
        public function templateMessageSend($openid, $templateId, $data, $uri = '');

        /**
         * 保存天择支付订单
         * @param $data
         * @return mixed
         */
        public function saveTzOrder($data);

        /**
         * 发送微信模板
         * @param $data
         * @return mixed
         */
        public function sendTemp($data);

        /**
         * 生成响应日志
         * @return bool
         */
        public function createResponseStatus($url, $method, $request_body, $error_code, $error_msg, $response, $source = 'WX');

        /**
         * 计划任务执行发送模板消息
         * @return bool
         * @throws \think\db\exception\DataNotFoundException
         * @throws \think\db\exception\ModelNotFoundException
         * @throws \think\exception\DbException
         */
        public function executeSendTemp();
    }